<% content_for :title do %>Display all users<% end %>
<h1>All Users in the User Table!</h1>

<div class="notice-area">
	<%= notice %>
</div>

<table class="table">
	<thead>
		<tr>
			<th>Name</th>
			<th>Email Address</th>
			<th>Date Added</th>
		</tr>
	</thead>

	<tbody>
		<% @users.each do |user| %>
			<tr>
				<td><%= user.first_name + " " + user.last_name %></td>
				<td><%= user.email_address %></td>
				<td><%= user.created_at %></td>
		        <td><%= link_to 'Show', user_path(user) %></td>
		        <td><%= link_to 'Edit', edit_user_path(user) %></td>
		        <td><%= link_to 'Destroy', user_path(user), method: :delete, data: { confirm: 'Are you sure?' } %></td>				
			</tr>
		<% end %>
	</tbody>
</table>

<%= link_to 'New User', new_user_path %>
